package xyz.ddlnt.serviceusrclient.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import xyz.ddlnt.commonutil.result.Result;
import xyz.ddlnt.model.dto.NoteAddDTO;
import xyz.ddlnt.model.dto.NoteDTO;
import xyz.ddlnt.model.dto.NoteDirDTO;
import xyz.ddlnt.model.vo.NoteContentVO;
import xyz.ddlnt.model.vo.NoteVO;

import java.util.List;

/**
 * @author ZZULI_SE 210910
 * @data 2025/5/7 15:05
 */
//@FeignClient(name = "service-usr", url = "http://yixuewang-service-usr:9015", path="/note")
//@FeignClient(name = "service-usr", url = "http://localhost:9005", path="/note")
@FeignClient(value = "service-usr" ,  path="/note")
public interface NoteFeignClient {

    /**
     * 新增笔记
     * @param noteAddDTO
     * @return
     */
    @PostMapping("/addNote")
    Result<NoteVO> addNote(@RequestBody NoteAddDTO noteAddDTO);

    /**
     * 删除笔记
     * @param id
     * @return
     */
    @DeleteMapping("/deleteNote")
    Result<Boolean> deleteNote(@RequestParam Long id);

    /**
     * 修改笔记标题
     * @param noteDTO
     * @return
     */
    @PutMapping("/updateNoteTitle")
    Result<Boolean> updateNoteTitle(@RequestBody NoteDTO noteDTO);

    /**
     * 更新笔记
     * @param noteDTO
     * @return
     */
    @PutMapping("/updateNote")
    Result<Boolean> updateNote(@RequestBody NoteDTO noteDTO);

    /**
     * 更新笔记前节点子集
     * @param noteDirDTO
     * @return
     */
    @PutMapping("/updateNoteChildNodes")
    Result<Boolean> updateNoteChildNodes(@RequestBody NoteDirDTO noteDirDTO);

    /**
     * 获取笔记目录·
     * @param noteDirDTO
     * @return
     */
    @PostMapping("/getNoteDir")
    Result<List<NoteVO>> getNote(@RequestBody NoteDirDTO noteDirDTO);

    /**
     * 获取笔记内容
     * @param id
     * @return
     */
    @GetMapping("/getNoteContent")
    Result<NoteContentVO> getNoteContent(@RequestParam Long id);
}
